package Task3;

import java.util.Scanner;

//找出字符串中最长的数字串
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            String str = scanner.next();
            int i = 0;
            int j = 0;
            StringBuilder stringBuilder = new StringBuilder();
            StringBuilder stringBuilder1 = new StringBuilder();
            while(i < str.length()){
                j = i;
               while ( j < str.length() && str.charAt(j) >= '0' && str.charAt(j) <= '9'){
                   stringBuilder.append(str.charAt(j));
                   j++;
               }
               if(stringBuilder.length() > stringBuilder1.length()){
                   stringBuilder1.delete(0,stringBuilder.length());
                   stringBuilder1.append(stringBuilder);
               }
               //每次循环清空stringBuilder
               stringBuilder.delete(0,stringBuilder.length());
               if( i < j){
                   i = j;
               }else{
                   i++;
               }
            }
            str = stringBuilder1.toString();
            System.out.println(str);
        }
    }
}
